<?php
	include_once("../include/init.php");
	include_once("admin_init.php");
	$sql = "SELECT * FROM  tk_product_category";
	$res = mysql_query($sql);
	$info = [];
	if(mysql_num_rows($res)>0){
		while($list=mysql_fetch_assoc($res)){
			$info[]=$list;
		}
	}
		$info = get_cate($info);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>主体部分</title>
<base target="_self">
<link rel="stylesheet" type="text/css" href="skin/css/base.css" />
<link rel="stylesheet" type="text/css" href="skin/css/main.css" />
</head>
<body leftmargin="8" topmargin='8'>
<table width="98%" align="center" border="0" cellpadding="3" cellspacing="1" bgcolor="#CBD8AC" style="margin-bottom:8px;margin-top:8px;">
  <tr>
    <td background="skin/images/frame/wbg.gif" bgcolor="#EEF4EA" class='title' colspan="2"><span><img src='skin/images/frame/arr3.gif' style='margin-right:10px;'>添加商品分类</span></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>
    	<form action="product_cate.php" method="post" >
		<table style="margin-bottom:8px;margin-top:8px;margin-left:20px;">		
			 <tr>
				<td width="100px;">上级分类:</td>
				<td><select name="parent_id"><option value="0">品牌</option>
						<?php foreach( $info as $vo){?>
						<option value="<?=$vo['cate_id']?>"><?=str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;",$vo['level']-1).$vo['cate_name']?>
						</option>
						<?php }?>
					</select>
				</td>
			  </tr>
			   <tr>
				 <td>品牌名称:</td>
				 <td><input type="text" name="cate_name"/></td>
			   </tr>
			   <tr>
			   		<input type="hidden" name="act" value="add"/>
				 <td colspan="2" align="center" height="40px"><input type="submit" value=" 添加 " class="coolbt2"></td>
			   </tr>
		</table>
		</form>
	</td>
  </tr>
</table>
</body>
</html>